package com.sanpu.kxe.business.trade.view;

import android.text.Html;
import android.view.View;
import android.widget.TextView;

import com.sanpu.kxe.R;
import com.sanpu.kxe.base.BaseTitleActivity;
import com.sanpu.kxe.business.main.view.MainActivity;
import com.sanpu.kxe.business.trade.contract.TradeConfig;
import com.sanpu.kxe.module.roundview.RoundTextView;
import com.sanpu.kxe.utils.AppContextUtil;

import butterknife.Bind;

/**
 * Description：充值话费支付成功
 * Created by 薛勇军 on 2019/3/20.
 */

public class ChargerTelSuccessActivity extends BaseTitleActivity {

    @Bind(R.id.des)
    TextView vDes;
    @Bind(R.id.close)
    RoundTextView vClose;

    @Override
    protected int getLayoutResID() {
        return R.layout.activity_chargertel_success;
    }

    @Override
    protected void initView() {
        super.initView();
        commonTitle.setTitle("交易成功");
        commonTitle.setLeftOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                AppContextUtil.finishAllExclByActivity(MainActivity.class.getName());
            }
        });
        String pkgPrice = getIntent().getStringExtra(TradeConfig.INTENT_PKGINFO);

        try {
            vDes.setText(Html.fromHtml("成功充值<font color='#FF3F40'>" + pkgPrice + "</font>元话费"));
        } catch (Exception e) {
            e.printStackTrace();
        }
        vClose.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                AppContextUtil.finishAllExclByActivity(MainActivity.class.getName());
            }
        });
    }

    @Override
    protected boolean hasBindEventBus() {
        return false;
    }
}
